package net.oschina.app.ui;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import net.oschina.app.R;
import net.oschina.app.fragment.explore.EventFragment;


/**
 * Created by yzp on 2017/4/1.
 * 活动页面
 */
public class EventActivty extends AppCompatActivity {
    private Toolbar mEventToolbar;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.eventfragment_activty);

        initView();
        initData();
    }

    private void initView() {
        mEventToolbar = (Toolbar) findViewById(R.id.event_toolbar);
    }

    private void initData() {
        //设置回退
        mEventToolbar.setNavigationIcon(R.drawable.actionbar_back_icon_normal);
        //设置title
        mEventToolbar.setTitle("活动");
        mEventToolbar.setTitleTextColor(Color.WHITE);
        setSupportActionBar(mEventToolbar);

        mEventToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction transaction = fm.beginTransaction();
        transaction.replace(R.id.event_fragment_f, new EventFragment(), "");
        transaction.commit();
    }

   /* private void setArg(Intent intent, RecentlyExerciseFragment recentlyExerciseFragment) {
        Bundle args = new Bundle();
        args.putInt("index", intent.getIntExtra("index", 0));
        recentlyExerciseFragment.setArguments(args);
    }*/
}